import React from 'react'


import { useDispatch, useSelector } from 'react-redux'

export default function Son (props) {

    const count = useSelector((state) => {
        console.log(state)
        return state
    })

    //   把我们的 dispatch 释放出来 
    const dispatch = useDispatch()

    const handlerClick = () => {

        dispatch({ type: 'add', payload: 12 })

    }
    return (
        <>
            <div>Son    使用  store里面的数据： {count}</div>
            <button onClick={handlerClick}> son  按钮</button>

        </>

    )
}
